package com.ruoyi.food.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.food.domain.ComboGroup;
import com.ruoyi.food.domain.FoodDetail;
import com.ruoyi.food.domain.FoodSellout;
import com.ruoyi.food.domain.FoodType;
import com.ruoyi.common.core.web.domain.BaseEntity;
import com.ruoyi.food.domain.dto.FoodAdditionDTO;
import com.ruoyi.food.domain.dto.FoodTasteDTO;
import com.ruoyi.food.handle.AdditionListTypeHandler;
import com.ruoyi.food.handle.TasteListTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.List;


/**
 * 食物
 *
 * @author Administrator
 * @date 2023/03/14
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@TableName(value = "t_food", autoResultMap = true)
public class Food extends BaseEntity {

    /**
     * 菜品ID
     */
    @TableId
    private Long id;
    /**
     * 所属租户
     */
    private Long sellerId;

    /**
     * 类别 0菜品 1套餐
     */
    private Integer category;
    /**
     * 菜品编号
     */
    private String foodNo;
    /**
     * 菜品名称
     */
    private String foodName;

    @TableField(exist = false)
    private List<Long> useRangeList;
    /**
     * 使用范围
     */
    private String useRange;
    /**
     * 所属分类
     */
    private Long typeId;
    /**
     * 简码
     */
    private String shortCode;
    /**
     * 排序
     */
    private Integer sort;
    /**
     * 菜品价钱
     */
    private BigDecimal price;
    /**
     * 会员价
     */
    private BigDecimal memberPrice;
    /**
     * 微信会员价
     */
    private BigDecimal wechatMemberPrice;
    /**
     * 成本价
     */
    private BigDecimal costPrice;
    /**
     * 提成
     */
    private String commission;
    /**
     * 菜品别名
     */
    private String foodAlias;
    /**
     * 状态(1正常 0停用)
     */
    private Integer status;
    /**
     * 口味备注
     */
    private String flavorRemark;
    /**
     * 菜品介绍
     */
    private String foodRemark;
    /**
     * 菜品图片
     */
    private String foodImg;
    /**
     * 启用称重(1是0否)
     */
    private Integer enableWeight;
    /**
     * 启用开台预定(1是0否)
     */
    private Integer enableOpenReserve;
    /**
     * 启用时价菜(1是0否)
     */
    private Integer enableShijia;
    /**
     * 库存
     */
    private Integer stock;
    /**
     * 允许折扣 0不允许 1允许
     */
    private Integer enableDiscount;
    /**
     * 最低折扣
     */
    private Double minDiscount;
    /**
     * 备注
     */
    private String remark;

    /**
     * 规格
     */
    private String spec;
    /**
     * 多规格开关 0关 1开
     */
    private Integer specMul = 0;

    /**
     * 多规格配置
     */
    @TableField(exist = false)
    private List<FoodDetail> specList;

    /**
     * 多口味开关 0关 1开
     */
    private Integer tasteMul = 0;

    /**
     * 多口味配置
     */
    @TableField(typeHandler = TasteListTypeHandler.class)
    private List<FoodTasteDTO> tasteList;

    /**
     * 多口味开关 0关 1开
     */
    private Integer additionMul = 0;

    /**
     * 多口味配置
     */
    @TableField(typeHandler = AdditionListTypeHandler.class)
    private List<FoodAdditionDTO> additionList;

    @TableField(exist = false)
    private List<ComboGroup> comboGroupList;

    @TableField(exist = false)
    private FoodType foodType;

    @TableField(exist = false)
    private FoodSellout sellout;

    /**
     * 平板下的排序
     */
    private Integer padSort;

    /**
     * 平板下的状态
     */
    private Integer padStatus;

    /**
     * 是否是平板下的推荐菜 0.否 1.是
     */
    private Integer ifPadRecommend;
}
